<include file="__THEME__/header" />
<link rel="stylesheet" href="../Public/gift.css" type="text/css" charset="utf-8" />
<script src="../Public/js/gift.js" type="text/javascript"></script>
<script type="text/javascript">
function selectItems(id){
	$('.gift_items').each(function(test){
		$(this).attr('class','gift_items');
	});
	$('.giftblock').each(function(){
		$(this).css('display','none');
	});
	$('#gifts'+id).css('display','block');
	$('#item'+id).attr('class','gift_items on');
}

function sendGift(id){
	var clickid = 'gift'+id;
	$('.gifts').each(function(){
		if($(this).attr('id')==clickid){
			$(this).attr('class','gifts hand on');
		}else{
			$(this).attr('class','gifts hand');
		}
	});
	var temp_gift = $('#gift'+id).clone();
	$('#gift_info').html('');
	$('#gift_info').append(temp_gift.html());
	$('#gift_id').val(id);

	scroller('sendto', 1000) 
}
function check(){
	if(!$('#gift_id').val()){
		ui.error('请选择礼物');
		return false;
	}
	if(!($('#ui_fri_ids').val())){
		ui.error('请选择礼物发送对象');
		return false;
	}
}
</script>
<include file="../Public/_mainNav" />
<div class="content no_bg">
  <div class="main no_l">
    <div class="mainbox">
      <div class="mainbox_C" style="margin-right:0">
        <div class="tab-menu"> 
          <ul >
            <volist name = 'categorys' id = 'category'><li><a href="javascript:void(0)" class="" onclick='selectItems({$category['id']})' id='item{$category['id']}' ><span>{$category['name']}</span></a></li></volist>
          </ul>
        </div>
        <div style="padding:20px;">
          <php>if($uid&&$uid!=$mid){</php>
          <div style="font-size:16px;font-weight:bold;color:#666;margin-top:10px;">已选定获赠者： <img src="./thumb.php?w=30&h=30&url={$uid|getUserFace}" /> {$uid|getUserName}</div>
          <php>}</php>
          <div class="f14px fB lh35">选择一个礼物:</div>
          
          <volist name = 'categorys' id = 'category'>
          <div class="giftblock" id='gifts{$category['id']}' style="display:none;" >
          <ul>
            <volist name = "category['gifts']" id='gift'>
              <li class='gifts hand' title="点击选择" onclick='sendGift({$gift['id']})' id='gift{$gift['id']}'>
              <img src="{$gift['img']|realityImageURL}" /><br />
              {$gift['name']}<br />
              限量：{$gift['num']}个<br />
              {$gift['price']}点{$money.alias}
              </li>
            </volist>
            <div class="c"></div>
          </ul>
        </div>
        </volist>
        <a name="sendto" id="sendto"></a>
        <div id='gift_info'></div>
        <form action="__URL__&act=send" method='post' onsubmit='return check()'>
          <div style="margin-top:20px;">
            <h2 class="f14px fB lh30">我目前拥有的 {$money.alias} 是： {$money.credit}</h2>
          </div>
          <div style="margin-top:30px;">
            <h2 class="f14px fB lh30">选择接收人：</h2>
            <div style="width:360px;">{:W('SelectFriends',array('uid'=>$_GET['uid']))}</div>
            <div style="margin-top:20px;">
              <h2 class="f14px fB lh30">附加消息：</h2>
              <p style="margin:0; padding:0;">不能超过200个字符</p>
              <textarea cols="50" rows="6" class="Text20" name='sendInfo'></textarea>
            </div>
            <div>
              <div class="lh30 fB f14px">选择赠送的方式：</div>
              <div>
                <div class="left">
                  <input checked="checked" value="1" id="public" name="sendWay" type="radio" />
                </div>
                <div style="margin:0 0 20px 20px;" class="lh18">
                  <label for="public"><strong>公开赠送</strong><br />
                    <span class="cGray2">其它人可以看见你的礼物和消息。<br />
                    这个礼物将显示在接受人的礼物盒和并可发到微薄。</span></label>
                </div>
                <div class="left">
                  <input value="2" id="private" name="sendWay" type="radio"/>
                </div>
                <div style="margin-left:20px;" class="lh18">
                  <label for="private"> <strong>私下赠送</strong><br />
                    <span class="cGray2">只有接收礼物的人能看见你的名字和消息<br />
                    这个礼物将只出现在接收人的礼物，其它人只能看见礼物。</span></label>
                </div>
                <br />
                <div class="left">
                  <input value="3" id="anonymous" name="sendWay" type="radio" />
                </div>
                <div style="margin:0 0 20px 20px;" class="lh18">
                  <label for="anonymous" > <strong>匿名赠送</strong><br />
                    <span class="cGray2">接收礼物的人能看见你的消息，但不显示你的名字。<br />
                    这个礼物将显示在接收人的礼物盒里，但其它人只能看见礼物。</span></label>
                </div>
                <input type='hidden' name='giftId' value='' id='gift_id'>
                </input>
              </div>
            </div>
            <div class="mt10">
              <input type="submit" class="btn_b" style="margin-right:5px;" value="赠送礼物" />
              <input type="button" class="btn_w" value="取消" />
            </div>
          </div>
        </form>
      </div>
    </div>
    <div class="c"></div>
  </div>
</div>
</div>
<include file="__THEME__/footer" />
<script>
$(function(){
	selectItems(1);
});
</script>